#ifndef FACEANIMATIONWIDGET_H
#define FACEANIMATIONWIDGET_H

#include <QWidget>
#include <QTimer>

class FaceAnimationWidget : public QWidget
{
    Q_OBJECT
public:
    explicit FaceAnimationWidget(QWidget *parent = nullptr);


    void startEyeBlinkAnimation();
    void startMouthSmellAnimation();

    void stopEyeBlinkAnimation();
    void stopMouthSmellAnimation();

public slots:
    void updateEyeAnimation();
    void updateMouthAnimation();

protected:
    void paintEvent(QPaintEvent *);
    void drawBorder(QPainter *painter);
    void drawEye(QPainter *painter);
    void drawMouth(QPainter *painter);
    void drawNose(QPainter *painter);

private:
    // border
    quint32 margin;
    quint32 radius;
    quint32 radius_extern;

    // eye
    bool eye_blink_derection;
    quint32 eye_blink_min;
    quint32 eye_blink_step;
    quint32 eye_blink_max;

    // nose
    quint32 noselength;
    quint32 noseradius;

    // mouth
    quint32 mouthlength;
    quint32 mouth_smell_step;
    quint32 mouth_smell_max;

    QTimer* timerEyeAnimation;
    QTimer* timerMouthAnimation;
};

#endif // FACEANIMATIONWIDGET_H
